package com.zslibrary.Enum;

import android.annotation.SuppressLint;
import androidx.annotation.IntDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

public class Protocol {
    public static final short MSG_ALIVE=0;
    public static final short MSG_POLL=1;
    public static final short MSG_GET_HARDWARE_VERSIONS=50;
    public static final short MSG_GET_SOFTWARE_VERSIONS=51;
    public static final short MSG_START_UPDATE=52;
    public static final short MSG_UPDATE_PACKAGE=53;
    public static final short MSG_ABORT_UPDATE=54;
    public static final short MSG_START_UPDATE_EXT=55;
    public static final short MSG_RUN_UPDATE_ALL=56;
    public static final short MSG_SOFTWARE_UPDATE_END=99;
    public static final short MSG_SET_PRODUCT_DEPS=100;
    public static final short MSG_SET_DEFAULT_ADJS=101;
    public static final short MSG_SET_USER_ADJS=102;
    public static final short MSG_GET_CLASS_ADJ_INFOS=103;
    public static final short MSG_GET_ADJ_NAMES=104;
    public static final short MSG_GET_ADJ_NAMES_BY_ADJ_IDS=105;
    public static final short MSG_GET_ADJ_INFO=106;
    public static final short MSG_SET_COMPONENT_OPTION_INFOS=107;
    public static final short MSG_SET_CONNECTIONS=108;
    public static final short MSG_DUMMY_ADUJSTMENT_END=199;
    public static final short MSG_GET_CLASS_TEST_INFOS=200;
    public static final short MSG_GET_CLASS_TEST_NAMES=201;
    public static final short MSG_RUN_COMPONENT_TEST=202;
    public static final short MSG_GET_TEST_INFOS=203;
    public static final short MSG_DIAGNOSIS=204;
    public static final short MSG_P_TEST=205;
    public static final short MSG_DUMMY_COMPONMENTTEST_END=299;
    public static final short MSG_REPORT_BEGIN=300;
    public static final short MSG_REPORT_END=301;
    public static final short MSG_REPORT_STR=302;
    public static final short MSG_REQUIRE_KEYS=400;
    public static final short MSG_SEND_KEY=500;
    public static final short MSG_TRACE=600;
    public static final short MSG_SET_COMP_ERR=700;
    public static final short MSG_CLEAR_COMP_ERR=701;
    public static final short MSG_MAKE_PRODUCT=800;
    public static final short MSG_ABORT_JUG=801;
    public static final short MSG_GET_VALUE=810;
    public static final short MSG_SET_VALUE=811;
    public static final short MSG_STANDBY=812;
    public static final short MSG_WAKEUP=813;
    public static final short MSG_FUNCTION_OFF=814;
    public static final short MSG_SERVICE_ON=815;
    public static final short MSG_SERVICE_OFF=816;
    public static final short MSG_GET_BOARD_STATUS=830;
    public static final short MSG_REQUEST_GATE_STATUS=831;
    public static final short MSG_ESCROW_MOTOR=832;
    public static final short MSG_REQUEST_SENSOR_VALUE=833;
    public static final short MSG_DUMMY_PRODUCT_END=899;
    public static final short MSG_PRODUCT_DONE=900;
    public static final short MSG_PRODUCT_ON_PROGRESS=901;
    public static final short MSG_PRODUCT_SHOW_MSG=902;
    public static final short MSG_BOARD_RESET=1000;
    public static final short MSG_BOARD_STATUS=1001;
    public static final short MSG_REPLY_GATE_STATUS=1002;
    public static final short MSG_SERVICE_ON_DONE=1003;
    public static final short MSG_SERVICE_OFF_DONE=1004;
    public static final short MSG_STANDBY_DONE=1005;
    public static final short MSG_FUNCTION_OFF_DONE=1006;
    public static final short MSG_WAKEUP_DONE=1007;
    public static final short MSG_GET_SENSOR_VALUE=1020;
    public static final short MSG_DUMMY_IMACHINELISTNER_END=1099;
    public static final short MSG_GET_STRING=1400;
    public static final short MSG_SET_STRING=1401;

    @IntDef(value={
            MSG_ALIVE,
            MSG_POLL,
            MSG_GET_HARDWARE_VERSIONS,
            MSG_GET_SOFTWARE_VERSIONS,
            MSG_START_UPDATE,
            MSG_UPDATE_PACKAGE,
            MSG_ABORT_UPDATE,
            MSG_START_UPDATE_EXT,
            MSG_RUN_UPDATE_ALL,
            MSG_SOFTWARE_UPDATE_END,
            MSG_SET_PRODUCT_DEPS,
            MSG_SET_DEFAULT_ADJS,
            MSG_SET_USER_ADJS,
            MSG_GET_CLASS_ADJ_INFOS,
            MSG_GET_ADJ_NAMES,
            MSG_GET_ADJ_NAMES_BY_ADJ_IDS,
            MSG_GET_ADJ_INFO,
            MSG_SET_COMPONENT_OPTION_INFOS,
            MSG_SET_CONNECTIONS,
            MSG_DUMMY_ADUJSTMENT_END,
            MSG_GET_CLASS_TEST_INFOS,
            MSG_GET_CLASS_TEST_NAMES,
            MSG_RUN_COMPONENT_TEST,
            MSG_GET_TEST_INFOS,
            MSG_DIAGNOSIS,
            MSG_P_TEST,
            MSG_DUMMY_COMPONMENTTEST_END,
            MSG_REPORT_BEGIN,
            MSG_REPORT_END,
            MSG_REPORT_STR,
            MSG_REQUIRE_KEYS,
            MSG_SEND_KEY,
            MSG_TRACE,
            MSG_SET_COMP_ERR,
            MSG_CLEAR_COMP_ERR,
            MSG_MAKE_PRODUCT,
            MSG_ABORT_JUG,
            MSG_GET_VALUE,
            MSG_SET_VALUE,
            MSG_STANDBY,
            MSG_WAKEUP,
            MSG_FUNCTION_OFF,
            MSG_SERVICE_ON,
            MSG_SERVICE_OFF,
            MSG_GET_BOARD_STATUS,
            MSG_REQUEST_GATE_STATUS,
            MSG_ESCROW_MOTOR,
            MSG_REQUEST_SENSOR_VALUE,
            MSG_DUMMY_PRODUCT_END,
            MSG_PRODUCT_DONE,
            MSG_PRODUCT_ON_PROGRESS,
            MSG_PRODUCT_SHOW_MSG,
            MSG_BOARD_RESET,
            MSG_BOARD_STATUS,
            MSG_REPLY_GATE_STATUS,
            MSG_SERVICE_ON_DONE,
            MSG_SERVICE_OFF_DONE,
            MSG_STANDBY_DONE,
            MSG_FUNCTION_OFF_DONE,
            MSG_WAKEUP_DONE,
            MSG_GET_SENSOR_VALUE,
            MSG_DUMMY_IMACHINELISTNER_END,
            MSG_GET_STRING,
            MSG_SET_STRING,

    })

    @Retention(RetentionPolicy.SOURCE)
    public @interface RequestId{}

    private short mRequestId;
    public void setRequestId(@SuppressLint("SupportAnnotationUsage") @RequestId short r){
        mRequestId=r;
    }

    @SuppressLint("SupportAnnotationUsage")
    @RequestId
    public short getRequestId(){
        return mRequestId;
    }

}
